package com.heng.locks;


//可重入锁
public class ReEntryLockDemo3 {
    public static void main(String[] args) {
        final Object object = new Object();

        new Thread(()-> {
            synchronized (object){
                System.out.println(Thread.currentThread().getName()+"\t ---外层调用");
                synchronized (object){
                    System.out.println(Thread.currentThread().getName()+"\t ---中层调用");
                    synchronized (object){
                        System.out.println(Thread.currentThread().getName()+"\t ---内层调用");
                    }
                }
            }
        },"t1").start();
    }
}
